// Copyright (c) MatrixFramework. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Microsoft.EntityFrameworkCore;
using PhotoGalleryService.Photos;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

namespace PhotoGalleryService.EntityFrameworkCore;

/// <summary>
/// PhotoGallery服务的数据库上下文
/// </summary>
[ConnectionStringName("Default")]
public class PhotoGalleryServiceDbContext : AbpDbContext<PhotoGalleryServiceDbContext>
{
    /// <summary>
    /// 照片集合
    /// </summary>
    public DbSet<Photo> Photos { get; set; } = null!;

    public PhotoGalleryServiceDbContext(DbContextOptions<PhotoGalleryServiceDbContext> options)
        : base(options)
    {
    }

    protected override void OnModelCreating(ModelBuilder builder)
    {
        base.OnModelCreating(builder);

        builder.ConfigurePhotoGalleryService();
    }
}